//
//  httpTool.h
//  DaGuanJia
//
//  Created by 张斌 on 16/11/30.
//  Copyright © 2016年 ck. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AppDelegate.h"
@interface httpTool : NSObject
// NSlocalizeString 第一个参数是内容,根据第一个参数去对应语言的文件中取对应的字符串，第二个参数将会转化为字符串文件里的注释，可以传nil，也可以传空字符串@""。
//#define NSLocalizedString(key, comment) [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]

#define kDevice_Is_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
#define  adjustsScrollViewInsets(scrollView)\
do {\
_Pragma("clang diagnostic push")\
_Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"")\
if ([scrollView respondsToSelector:NSSelectorFromString(@"setContentInsetAdjustmentBehavior:")]) {\
NSMethodSignature *signature = [UIScrollView instanceMethodSignatureForSelector:@selector(setContentInsetAdjustmentBehavior:)];\
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];\
NSInteger argument = 2;\
invocation.target = scrollView;\
invocation.selector = @selector(setContentInsetAdjustmentBehavior:);\
[invocation setArgument:&argument atIndex:2];\
[invocation retainArguments];\
[invocation invoke];\
}\
_Pragma("clang diagnostic pop")\
} while (0)

#define JCNew64 [[UIApplication sharedApplication] statusBarFrame].size.height + self.navigationController.navigationBar.frame.size.height
#define kip @"http://www.hnjrfww.com"//域名
#define BAip @"http://114.215.249.25:8088"//域名
//#define BAip @"http://192.168.1.12:8080/b2b_service"//域名

#define BAwebsite @"1"//域名
#define BAlanguage @"0"//域名
#define BAtype @"1"//type

//#define BAip @"http://192.168.1.181:8080"//域名
//#define BAip @"http://192.168.1.153:8080/b2b_service"//域名

#define bSaveRegister @"/RegisterWebServicePort"//注册信息
#define bEditPassword @"/RegisterWebServicePort"//修改密码
#define blogin @"/LoginWebservicePort"//登陆
#define bcheckUserName @"/RegisterWebServicePort"//忘记密码-查看用户名是否存在
#define bcheckPhone @"/RegisterWebServicePort"//忘记密码-查看找回密码的手机号是否存在
#define bSendSms @"/RegisterWebServicePort"//忘记密码-发送短息验证码
#define bResetPassword @"/RegisterWebServicePort"//忘记密码-重置密码并发送短信（和邮件）
#define bcheckEmail @"/RegisterWebServicePort"//忘记密码-查看找回密码的邮箱是否存在
#define bSendEmail @"/RegisterWebServicePort"//忘记密码-发送重置密码邮件

#define bgetProductList @"/ProductWebServicePort"//商品列表接口
#define bMessageList @"/MessageWebservicePort"//联系信收件箱
#define bDemandList @"/DemandWebServicePort"//采购信息
#define bRegister @"/RegisterWebServicePort"//企业信息

#define bCart @"/CartWebServicePort"//加入购物车·




#define kperson @"http://www.hnjrfww.com/web/toRegister/savePaccounts?"//zz
#define kqiye @"http://www.hnjrfww.com/web/toRegister/saveAccounts?"//zz


#define kqiyehangye2 @"http://www.hnjrfww.com/web/toRegister/professionsChildList?pid="//qiye乡镇
#define kqiyelist @"http://www.hnjrfww.com/web/toRegister/toRegisterPaccList"//企业list
#define kqiyename @"http://www.hnjrfww.com/web/toRegister/valcname?accounts.regnum="//企业验证名字
#define kqiyeyanz @"http://www.hnjrfww.com/web/toRegister/toMphoneSmsCode?accounts.m_phone="//企业验证码
#define kpersonname @"http://www.hnjrfww.com/web/toRegister/valpname?paccounts.uname="//PERSON验证名字
#define kpersonhangye @"http://www.hnjrfww.com/web/comment/productProfessionList"//PERSON验证hy
#define kpersoncity2 @"http://www.hnjrfww.com/web/toRegister/districtList?tcode="//乡镇
#define ktoupiaolist @"http://www.hnjrfww.com/web/vote/votePeriodsHome?periodsId="//投票list
#define kpersoncity @"http://www.hnjrfww.com/web/toRegister/cityList"//改村庄
#define kpersonyanz @"http://www.hnjrfww.com/web/toRegister/toUnameSmsCode?paccounts.uname="//person验证码
#define kyanz @"http://www.hnjrfww.com/web/comment/toUsernameSmsCode?username="//改密码验证
#define kchangedmiam @"http://www.hnjrfww.com/web/comment/findPassword?username="//改密码
#define ktoupiaoxq @"http://www.hnjrfww.com/web/vote/optionId?id="//投票xq
#define ktoupiaoresult @"http://www.hnjrfww.com/web/vote/optionInfoPeriodsId?optionInfo.periodsId="//投票xq
#define ktoupiao @"http://www.hnjrfww.com/web/vote/toSave?optionId="//投票
#define kbendimore @"http://www.hnjrfww.com/web/article/articleClassId?article.ClassId="//更多
#define knewsxq @"http://www.hnjrfww.com/web/article/articleId?id="//新闻详情
#define kcpxq @"http://www.hnjrfww.com/web/production/productionId?id="//产品详情
#define khome @"http://www.hnjrfww.com/web/article/articleHome"//首页轮播图
#define kbendi @"http://www.hnjrfww.com/web/article/articleClassId?article.ClassId=2&numPerPage=20&"//本地动态
#define kbendisy @"http://www.hnjrfww.com/web/article/articleClassId?article.ClassId=2&numPerPage=5&"//本地动态
#define kvideo @"http://www.hnjrfww.com/web/article/articleImageVedio?type=6&numPerPage=20&"//视频
#define kimage @"http://www.hnjrfww.com/web/article/articleImageVedio?type=0&numPerPage=20&"//图片
#define kalllist @"http://www.hnjrfww.com/web/comment/productSelectAllList"//查询条件
#define kchaxun @"http://www.hnjrfww.com/web/production/productionList?&numPerPage=20&pageNum="//查询产品
#define ktuijainlist @"http://www.hnjrfww.com/web/production/productionList?production.flag=1&numPerPage=20&pageNum="//金融产品推荐

#define klogin @"http://www.hnjrfww.com/web/comment/vaildUserLogin?username="//登陆
#define kupdata @"http://www.hnjrfww.com/web/comment/versionRenewal?flag=ios&version="//自动更新
#define krzlist @"http://www.hnjrfww.com/web/appFinace/finaceList?username="//融资申请表单页面所有list
#define krzxq @"http://www.hnjrfww.com/web/appFinace/finaceId?username="//融资申请表单页面所有详情
#define krzsq @"http://www.hnjrfww.com/web/appFinace/productSelectAllList"//融资申请表单页面
#define krzsqtj @"http://www.hnjrfww.com/web/appFinace/finaceSave?username="//融资申请表单页面所有详情
#define kmima @"http://www.hnjrfww.com/web/comment/updatePassword?username="//融资申请表单页面所有详情
//http://www.hnjrfww.com/web/appFinace/finaceSave?username=
// 181 -----168
+(UIImage *)getThumbnailImage:(NSString *)videoURL;

+ (void)ZBGetNetDataWith:(NSString*)str withDic:(NSDictionary*)dic andSuccess:(void(^)(NSDictionary* dictionary))successBlock  andFailure:(void(^)())failueBlock;

+ (void)ZBPostNetDataWith:(NSString*)str withDic:(NSDictionary*)dic andSuccess:(void(^)(NSDictionary* dictionary))successBlock  andFailure:(void(^)())failueBlock;

+ (void)postUploadWithUrl:(NSString *)urlStr parameters:(id)parameters fileData:(NSData *)fileData name:(NSString *)name fileName:(NSString *)fileName fileType:(NSString *)fileType success:(void (^)(id responseObject))success fail:(void (^)())fail;

+ (void)postUploadWithUrl:(NSString *)urlStr  uploadImages:(NSArray *)images completion:(void(^)(NSString *url,NSError *error))uploadBlock andPramaDic:(NSDictionary *)paramaDic;

+ (NSString*)nowTime:(NSString*)dateType;
+ (BOOL)checkTelNumber:(NSString *) telNumber;
+(BOOL )isValidateEmail:( NSString  *)email;
+ (BOOL) validateIdentityCard: (NSString *)identityCard;
+ (NSString*)dictionaryToJson:(NSDictionary *)dic;
+(BOOL) isBlankString:(NSString *)string ;

@end
